-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to silence status update with empty string in NINJA_STA… #1816
Conversation
…TUS. Signed-off-by: Henner Zeller <h.zeller@acm.org>
Signed-off-by: Henner Zeller <h.zeller@acm.org>
Why not set |
Of course, you can always hack around things (and don't forget to prefix grep with In general it should be possible to tell a tool to not output anything that is not relevant to its function. And in particular if it is some terminal trickery that is cute when it happens to be executed in a fully featured terminal but distracting and unhelpful when not. Really the relevant thing we want to see when compiling something is the errors and warnings, not much more. In bazel, there is |
I'd slightly less prefer There is a good use for an actual So I suggest to add two options
If that sounds good, I can make it so. |
Ah thanks for clearing that up, I forgot what #968 was about. I don't see the need to supress ALL output though - one can use tup uses
Btw: Have a look at #1045. If the description was part of |
Ok, so I also like the idea to add The behavior of So to get this rolling I can send two pull request that build on each other (or, if you prefer, put it in one)
|
I think we should do the |
Refined pull request after discussion in ninja-build#1816 Signed-off-by: Henner Zeller <h.zeller@acm.org>
Alright, updated pull request in #1818 |
Refined pull request after discussion in ninja-build#1816 Signed-off-by: Henner Zeller <h.zeller@acm.org>
I typically run ninja inside emacs to compile and generate the compiler messages to step through. The 'terminal' emacs provides does not allow for in-place updates of the status update line, so it scrolls with non-relevant information between actual compiler errors or warnings.
So ideally, it was possible to silence the output if the user just chooses to, so that only actual compiler outputs, but not the build rule invocations. So well adhering to the "no news are good news" paradigm.
The presented solution in this pull request is the simplest: if the user sets the
NINJA_STATUS
formatting string to an empty string, this now is interpreted to not show any status. IMHO a good, no-surprise way to express that intent.Downside of course is that this changes behavior: is some existing user set the environment variable to an empty string before, they got build rules, but no prefix; now this would not output anything. Question is how often this is used in this way ?
Potential alternatives:
BuildConfig::NO_STATUS_UPDATE
and wire it up to a command line option and/or environment variable. More involved, but it would preserve the existing use-case of setting NINJA_STATUS to an empty string and still get non-prefixed output.getenv("TERM") == "dumb"
(which is what emacs sets when compiling). This might work well in practice but sounds a bit like too much 'magic' as there was no explicit user choice.